const Service = require('egg').Service;

class TransactionconfigService extends Service {
    async insert(opt) {
        try {
            const data = await this.app.mysql.insert('transactionconfig', opt);
            return data;
        } catch (err) {
            this.ctx.throw(this.app.config.code.ERROR, err);
        }
    }
    async find(opt) {
        try {
            const data = await this.app.mysql.get('transactionconfig', opt);
            return data;
        } catch (err) {
            this.ctx.throw(this.app.config.code.ERROR, err);
        }
    }
    async findAll(opt) {
        try {
            const data = await this.app.mysql.select('transactionconfig', opt);
            return data;
        } catch (err) {
            this.ctx.throw(this.app.config.code.ERROR, err);
        }
    }
}

module.exports = TransactionconfigService;